# -*- coding: utf-8 -*-
from addEmployee import *
from read_data import *




def run_tests(user_list, index):
    for m in user_list:
        data1['login']['data']['userNumber'] = m
        data1['EntrantInfo']['data']['counselorNumber'] = m
        data1['ProcessOfGoAdmission']['data']['userNumber'] = m
        data2['login']['data']['userNumber'] = m
        data2['EntrantInfo']['data']['counselorNumber'] = m
        data2['ProcessOfGoAdmission']['data']['userNumber'] = m

        start_time = time.time()   # 记录开始时间
        for i in range(index):
            test_employee_entry().ready_('154')
            test_employee_entry().test_send_information()
            test_employee_entry().test_scanningcode()  # hhx提交入职信息（相当于小程序扫码入职）
            test_employee_entry().test_application_process()
            test_employee_entry().test_approval_process()
            test_employee_entry().test_creat_contract()
            test_employee_entry().test_send_contract()
            test_employee_entry().test_confirm_duty()
            test_employee_entry().test_GoAdmission()
            test_employee_entry().test_billing_process()
        end_time = time.time()   # 记录结束时间
        run_time = end_time - start_time    # 计算运行时间（单位为秒）
        print("脚本运行时间：", round(run_time, 2), '秒')

if __name__ == "__main__":
    uuu=deal_data(columns_to_read,a,b,c)
    list1 = uuu[0]
    list2 = uuu[1]
    list3 = uuu[2]
    # print(list1)
    # print(list2)
    # print(list3)
    lists=[list1,list2,list3]
    print(lists)
    for l in lists:
        if l==list1:
            run_tests(list1,1)
        if l==list2:
            run_tests(list2,2)
        if l==list3:
            run_tests(list3,3)

